package com.xiangyang.controller;

import com.xiangyang.entity.Supplier;
import com.xiangyang.enums.UpdateResultStatus;
import com.xiangyang.entity.dto.Result;
import com.xiangyang.service.ISupplierService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/Supplier")
public class SupilerController {
    @Autowired
    private ISupplierService supplierService;
        //修改供应商信息
        @PostMapping("/SupplierManagement")
         public UpdateResultStatus updateVendor(Long vendorId){
     return supplierService.updateVendor(vendorId);
    }
    //删除供应商信息
    @PostMapping("/SupplierManagement/delete")
    public boolean deleteVendor(Long vendorId){
     return supplierService.deleteVendor(vendorId);
    }
    //添加供应商信息
    @PostMapping("/SupplierManagement/add")
        public String insertVendor(@RequestBody Supplier supplier){
            return supplierService.insertVendor(supplier);
    }
    //查询供应商信息
    @PostMapping("/SupplierManagement/select")
    public Result selectVendor(Supplier Supplier){
        return supplierService.selectVendor(Supplier);
    }
}
